//
//  HHTweet.m
//  oschina
//
//  Created by hjl on 16/4/1.
//  Copyright © 2016年 hjl. All rights reserved.
//

#import "HHTweet.h"

@implementation HHTweet

+ (NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{
        @"ID" : @"id",
    };
}

// 计算cell的高度
- (CGFloat)cellHeight{
    if(!_cellHeight){
        CGFloat margin = 10;
        CGFloat nameLabelH = 18;
        CGFloat iconImageW = 40;
        CGFloat timeImageW = 18;

        _cellHeight = margin + nameLabelH + margin + margin + timeImageW + margin;
        CGSize maxSize = CGSizeMake(HHWidth - iconImageW - 3 * margin, MAXFLOAT);
        
        CGFloat cententLableH = [self.body boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14]} context:nil].size.height;
        _cellHeight += cententLableH;
    }
    return _cellHeight;
}

@end




